import Axios, { downLoadFile } from '@/utils/request';
import { ManualEventRepVO, ManualEventDTO } from '../vo/manual-processing';
import { TransfiniteIndicatorDetailDTO } from '../vo/transfinite-Indicator';

export default class API {
    /**
     * 偏严指标复核明细列表
     * @returns
     */
    static strictDetailCheckList(data: TransfiniteIndicatorDetailDTO): Promise<any> {
        return Axios.post('/middle/strict/query', data);
    }

    /**
     * 偏严指标复核明细导出
     * @param data
     */
    static downLoadFileStrictCheck(data: any) {
        downLoadFile({
            url: '/middle/strict/export',
            method: 'post',
            data: data,
        });
    }

    /**
     * 复核发起
     * @source
     */
    static checkInitiate(keys: string[]): Promise<any> {
        return Axios.post('/manual/check/initiate', keys);
    }

    /**
     * 复核关闭
     * @source
     */
    static checkShut(keys: string[]): Promise<any> {
        return Axios.post('/manual/check/shut', keys);
    }

    /**
     * 复核删除
     * @source
     */
    static checkDelete(keys: string[]): Promise<any> {
        return Axios.post('/manual/check/delete', keys);
    }

    /**
     * 复核导出
     * @param data
     */
    static downLoadFileCheck(data: any) {
        downLoadFile({
            url: '/middle/strict/export',
            method: 'post',
            data: data,
        });
    }

    /**
     * 调整计划详情
     * @source
     */
    static checkDetailByCode(code: string): Promise<any> {
        return Axios.post('/manual/check/detail/byCode', code);
    }

    /********人工处理 */
    /**
     * 人工录入列表
     * @source
     */
    static transfiniteIndicatorDetailManualList(data: ManualEventDTO): Promise<any> {
        return Axios.post('/middle/Labour/query', data);
    }

    /**
     * 人工录入管理明细查询
     * @source {overrunEventId}
     */
    static labourDetail(data: { overrunEventId: string }): Promise<any> {
        return Axios.post('/middle/Labour/detail', data);
    }

    /**
     * 人工新增录入
     * @source
     */
    static addEnter(data: ManualEventRepVO): Promise<any> {
        return Axios.post('/middle/Labour/insert', data);
    }

    /**
     *  人工录入关闭
     * @source
     */
    static enterShut(keys: string[]): Promise<any> {
        return Axios.post('/manual/enter/shut', keys);
    }

    /**
     * 人工录入删除
     * @source
     */
    static enterDelete(keys: string[]): Promise<any> {
        return Axios.post('/manual/enter/delete', keys);
    }

    /**
     * 人工调整计划详情
     * @source
     */
    static manualEnterDetailByCode(code: string): Promise<any> {
        return Axios.post('/manual/enter/detail/byCode', code);
    }

    /**
     * 人工处理导出
     * @param data
     */
    static downLoadFileTransfiniteManual(data: any) {
        downLoadFile({
            url: '/middle/Labour/export',
            method: 'post',
            data: data,
        });
    }

    /**
     * 新增追踪事件
     * @source
     */
    static feedbackInsert(data: any): Promise<any> {
        return Axios.post('/middle/feedback/insert', data);
    }

    /**
     * 调整计划查询
     * @source
     */
    static feedbackQuery(data: any): Promise<any> {
        return Axios.post('/middle/feedback/query', data);
    }

    /**
     * 投资经理
     */
    static investManagerCollect(data: { fundCode?: any[] }): Promise<any> {
        return Axios.post('/middle/investManager/collect', data);
    }
}
